package cn.wolfcode.wolf2w.business.api.factory;

import cn.wolfcode.wolf2w.business.api.RemoteDestinationEsService;
import cn.wolfcode.wolf2w.business.api.domain.DestinationEs;
import cn.wolfcode.wolf2w.common.core.domain.R;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class RemoteDestinationEsFallbackFactory implements FallbackFactory<RemoteDestinationEsService> {
    @Override
    public RemoteDestinationEsService create(Throwable cause) {
        return new RemoteDestinationEsService() {
            @Override
            public R<?> initDestinationEs(DestinationEs destinationEs, String source) {
                return R.fail("初始化攻略Es数据失败:" + cause.getMessage());
            }
        };
    }
}
